define(['modules/fetch'],function(fetch){

    function loadSidebarData(param={}, fn){
        var pn = param.pn ? param.pn : 0;
        var ps = param.ps ? param.ps : 20;
        var storyId = param.story_id;
        if(isNaN(parseInt(storyId))){
            console.log("loadSidebarData param error");
            return false;
        }
        fetch('listChaptersByStoryId', { pn: 0, ps: 20, story_id: storyId},
            function (result) {
                if(0 == result.errno ){
                    fn && fn(result);
                }
            },
            function(data) {
                console.log("ajax faild");
            }
        );
    }
    var vueSidebarData = {
        listbarList:[],
    };
   
    return loadSidebarData;
});